//
//  StringHelper.h
//
//  Created by ZhàoYǒng on 23/10/2017.
//  Copyright © 2017 ZhàoYǒng. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface StringHelper : NSObject

/// NSNumber、NSString、NSData转换为NSString
NSString * _Nullable StringFromObject(id _Nullable object);
/// 汉字转换为拼音NSString
NSString * _Nullable StringGetPinyin(NSString * _Nullable string, BOOL isTone);
/// NSString转换为MD5字符串
NSString * _Nullable StringGetMD5(NSString * _Nullable string);
/// 距离当前时间间隔，返回 刚刚、分钟、小时、天、月、年
NSString * _Nullable StringGetComparedTime(NSString * _Nullable string);
/// 距离当前时间间隔，返回具体时间 yyyy-MM-dd HH:mm
NSString * _Nullable StringGetComparedDetailTime(NSTimeInterval time1970);
/// 判断是否为NSString
BOOL StringIsValid(id _Nullable string);
/// 验证手机号
BOOL StringIsValidMobile(NSString * _Nullable mobile);
/// 验证字符串度 min~max位有效
BOOL StringIsValidLength(NSString * _Nullable string, NSInteger min, NSInteger max);
/// 验证电子邮箱
BOOL StringIsValidEmail(NSString * _Nullable email);
/// 验证是否是数字
BOOL StringIsValidNumber(NSString * _Nullable string);
/// 验证是否是数字或字母
BOOL StringIsValidLetterOrNumber(NSString * _Nullable string);
/// 验证是否是同时包含数字和字母
BOOL StringIsValidLetterAndNumber(NSString * _Nullable string);
/// 验证是否包含汉字
BOOL StringHasChinese(NSString * _Nullable string);
/// 获取两个字符串的相似度
float StringLikePercent(NSString * _Nullable ori, NSString * _Nullable target);

@end
